/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Socket;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;

/**
 *
 * @author hcc25_000
 */
public class Server {
    /**
     * 
     * @param args 
     */
    public static void main(String[] args){
        BufferedReader br=null;
        PrintWriter pw=null;
        try{
            ServerSocket server=new ServerSocket(2000);
            Socket s=server.accept();
            
            br=new BufferedReader(new InputStreamReader(s.getInputStream()));
            pw=new PrintWriter(s.getOutputStream(),true);
            
            String res1=br.readLine();
            String res2=br.readLine();
            pw.println(res1+res2);
        } catch (IOException ex) {
            ex.printStackTrace();
        }finally{
           try{
              br.close();
              pw.close();
           }catch(IOException ex){
               
           }
        }
    }
}
